package no.sachmuld.methodcombination.examples.annotation.combo.foo;

import no.sachmuld.methodcombination.api.CrosscuttingBehaviour;
import no.sachmuld.methodcombination.api.MethodInvocation;

/**
 *
 */
public class TransactionalBehaviour extends CrosscuttingBehaviour {

    @Override
    public Object around(MethodInvocation<?> methodInvocation) {
        System.out.println("begin transaction");
        try {
            return methodInvocation.proceed();
        } finally {
            System.out.println("commit transaction");
        }
    }
}
